﻿using System;
using System.Linq;
using NUnit.Framework;

namespace Shinkansen.Mvc.Test
{
    [TestFixture]
    public class ResourceCollectorTest
    {
        [Test]
        [ExpectedException (typeof (InvalidOperationException))]
        public void Does_not_accept_empty_js_path ()
        {
            var collector = new ResourceCollector ();
            collector.AddJs (null);
        }

        [Test]
        [ExpectedException (typeof (InvalidOperationException))]
        public void Does_not_accept_empty_css_path ()
        {
            var collector = new ResourceCollector ();
            collector.AddCss (null);
        }

        [Test]
        public void By_default_returns_empty_collections ()
        {
            var collector = new ResourceCollector ();

            Assert.IsEmpty (collector.JavaScript.ToList ());
            Assert.IsEmpty (collector.Css.ToList ());
        }

        [Test]
        public void By_default_returns_not_null_collections ()
        {
            var collector = new ResourceCollector ();

            Assert.IsNotNull (collector.JavaScript);
            Assert.IsNotNull (collector.Css);
        }
    }
}
